<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.pro.bean.Visit_View"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  	<base href="<%=basePath%>">
     <meta charset="utf-8" />
	<link href="css/bootstrap.css" rel="stylesheet">
	<link rel="stylesheet" href="css/main.css">
	<link rel="stylesheet" href="css/datepicker.css">

	<script src="js/jquery.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<script src="js/bootstrap-datepicker.js"></script>
	<title>浏览日志</title>

  </head>
  
    
    <%
    int rpage = 1;
    if(request.getParameter("page") != null)
    	rpage = Integer.parseInt(request.getParameter("page"));
  ArrayList<Visit_View> logs=(ArrayList<Visit_View>)request.getSession().getAttribute("list");
  
   %>
  <body>
    	<table class="table table-bordered table-hover">
				<tbody>
					<tr>
						<th>浏览时间</th>
						<th>公司名称</th>
						<th>被访问者姓名</th>
						<th>访问者所属部门</th>
						<th>访问者姓名</th>
					</tr>
                  
						<%
						System.out.println("size "+logs.size()+" rpage "+rpage);
						//out.println("size "+logs.size()+" rpage "+rpage);
						for(int i=(rpage-1)*9;i<logs.size() && i<(rpage-1)*9+9;++i) {
						if(i>=logs.size())
						break;
							Visit_View v = logs.get(i);
						%>
						  <tr>
						<td><%=v.getVisitTime() %></td>
						<td><%=v.getCmp() %></td>
						<td><%=v.getFirstName() %></td>
						<td><%=v.getUnitname() %></td>
						<td><%=v.getUsername()%></td>
							</tr>
						<%} %>

				
				</tbody>
			</table>
			<p>共<%=logs.size()/9+1 %>页&nbsp;第<%=rpage%>页        
          <%if(rpage>1){ %>
            <a href="cbxpage/view_log2.jsp?page=<%=rpage-1%>">上一页</a>
            <%}else{ %>
                                    上一页
         <%}%>
         <%if(rpage < logs.size()/9+1){ %>
        <a href="cbxpage/view_log2.jsp?page=<%=rpage+1%>">下一页</a>
            <%}else{ %>
                                   下一页
         <%}%></p>
  </body>
</html>
